<?php


namespace App\Models;


class ImAuthItems extends BaseModel
{
    protected $hidden = ['created_at', 'updated_at', 'status'];

    //子菜单
    public function children()
    {
        return $this->hasMany(self::class, 'parent_id', 'id')->where('type', 1)->where('status', 1)->orderBy('sort', 'asc');
    }

    //当前角色权限
    public function nowRoleAuth()
    {
        return $this->hasMany(ImRoleAuth::class, 'auth_id', 'id');
    }
}
